from django.urls import path, re_path, include
from rest_framework_jwt.views import obtain_jwt_token

from app_book import views
# 自动生成路由方法, 必须使用视图集
# router = SimpleRouter()  # 没有根路由  /user/ 无法识别
from rest_framework.routers import DefaultRouter

# router = DefaultRouter()  # 有根路由
# router.register(r'book', views.BookViewSet)
# router.register(r'hero', views.HeroViewSet)
# router.register(r'user', views.UserViewSet)

urlpatterns = [
    path('login/', obtain_jwt_token),  # 获取token
    # 认证地址
    path('api-auth/', include('rest_framework.urls', namespace='rest_framework')),
]

# urlpatterns += router.urls  # 把drf生成的路由, 注册到系统路由中
